package com.ycsyxt.admin.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.ycsyxt.admin.entity.ChatMessage;
import com.ycsyxt.admin.mapper.ChatMessageMapper;
import com.ycsyxt.admin.service.IChatMessageService;

/**
 * @author ycs(15241496739 @ 163.com)
 * @date 2021/10/7
 **/
@Service
public class ChatMessageServiceImpl implements IChatMessageService {
    @Autowired
    private ChatMessageMapper chatMessageMapper;

    /**
     * 查询聊天消息
     *
     * @param id 聊天消息ID
     * @return 聊天消息
     */
    @Override
    public ChatMessage selectChatMessageById(Long id) {
        return chatMessageMapper.selectChatMessageById(id);
    }

    /**
     * 查询聊天消息列表
     *
     * @param chatMessage 聊天消息
     * @return 聊天消息
     */
    @Override
    public List<ChatMessage> selectChatMessageList(ChatMessage chatMessage) {
        return chatMessageMapper.selectChatMessageList(chatMessage);
    }

    /**
     * 新增聊天消息
     *
     * @param chatMessage 聊天消息
     * @return 结果
     */
    @Override
    public int insertChatMessage(ChatMessage chatMessage) {
        return chatMessageMapper.insertChatMessage(chatMessage);
    }

    /**
     * 修改聊天消息
     *
     * @param chatMessage 聊天消息
     * @return 结果
     */
    @Override
    public int updateChatMessage(ChatMessage chatMessage) {
        return chatMessageMapper.updateChatMessage(chatMessage);
    }

    /**
     * 批量删除聊天消息
     *
     * @param ids 需要删除的聊天消息ID
     * @return 结果
     */
    @Override
    public int deleteChatMessageByIds(Long[] ids) {
        return chatMessageMapper.deleteChatMessageByIds(ids);
    }

    /**
     * 删除聊天消息信息
     *
     * @param id 聊天消息ID
     * @return 结果
     */
    @Override
    public int deleteChatMessageById(Long id) {
        return chatMessageMapper.deleteChatMessageById(id);
    }
}